import HTTP from '../utils/http';
import { API } from '../config/config';
export default class ApiService extends HTTP {
  findEssayClick(data) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.ESSAY_GET_CLICK,
        data,
        success(data) {
          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findEssayAll(data) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.ESSAY_GET_ALL,
        data,
        success(data) {
          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findEssay(data) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.ESSAY_GET,
        data,
        success(data) {
          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findEssayType(data) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.ESSAY_GET_TYPE,
        data,
        success(data) {
          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findFirendLink(id) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.FIREND_GET,
        data: id,
        success(data) {
          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findProject(id) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.PROJECT_GET,
        data: id,
        success(data) {

          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
  findType(id) {
    return new Promise((resolve) => {
      this.axiosPost({
        url: API.TYPE_GET,
        data: id,
        success(data) {

          resolve(data.data)
        }, error(error) {
          console.log('发生了错误');
        }
      })
    })
  }
}
